<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>libspotify: browse.c</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">libspotify
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">browse.c</div>  </div>
</div><!--header-->
<div class="contents">
<p>The browse.c example shows how you can use the album, artist, and browse functions. The example also include some rudimentary playlist browsing. It is part of the spshell program</p>
<div class="fragment"><pre class="fragment">
<span class="preprocessor">#include &quot;spshell.h&quot;</span>
<span class="preprocessor">#include &quot;cmd.h&quot;</span>

<span class="keyword">static</span> <a class="code" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48" title="A track handle.">sp_track</a> *track_browse;
<span class="keyword">static</span> <a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *playlist_browse;
<span class="keyword">static</span> <a name="_a0"></a><a class="code" href="structsp__playlist__callbacks.html">sp_playlist_callbacks</a> pl_callbacks;

<span class="keywordtype">void</span> print_track(<a class="code" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48" title="A track handle.">sp_track</a> *track)
{
    <span class="keywordtype">int</span> duration = <a name="a1"></a><a class="code" href="group__track.html#gac817937bd8d8355b6a1949b76d0b5560">sp_track_duration</a>(track);
    <span class="keywordtype">char</span> url[256];
    <a class="code" href="group__types.html#gaf90a23d6b662c96d52ac19f7f4bc1e39" title="A handle to the libspotify internal representation of a URI.">sp_link</a> *l;
    <span class="keywordtype">int</span> i;

<span class="preprocessor">#if WIN32</span>
<span class="preprocessor"></span>    printf(<span class="stringliteral">&quot; %s &quot;</span>, <a name="a2"></a><a class="code" href="group__track.html#gab17d380ac941e102af0f308ad885b3c3">sp_track_is_starred</a>(g_session,track) ? <span class="stringliteral">&quot;*&quot;</span> : <span class="stringliteral">&quot; &quot;</span>);
<span class="preprocessor">#else</span>
<span class="preprocessor"></span>    printf(<span class="stringliteral">&quot; %s &quot;</span>, <a class="code" href="group__track.html#gab17d380ac941e102af0f308ad885b3c3">sp_track_is_starred</a>(g_session,track) ? <span class="stringliteral">&quot;★&quot;</span> : <span class="stringliteral">&quot;☆&quot;</span>);
<span class="preprocessor">#endif</span>
<span class="preprocessor"></span>    printf(<span class="stringliteral">&quot;Track %s [%d:%02d] has %d artist(s), %d%% popularity&quot;</span>,
           <a name="a3"></a><a class="code" href="group__track.html#ga8eb423d3cc2cbfb743c7f23ffb8d0fad">sp_track_name</a>(track),
           duration / 60000,
           (duration / 1000) % 60,
           <a name="a4"></a><a class="code" href="group__track.html#ga0aa945fc43e35d36cc334a52735d83b2">sp_track_num_artists</a>(track),
           <a name="a5"></a><a class="code" href="group__track.html#ga4570f08f968edbff519b44d2241d2255">sp_track_popularity</a>(track));
    
    <span class="keywordflow">if</span>(<a name="a6"></a><a class="code" href="group__track.html#ga9d464ee4a5c8836b59888952b960223a">sp_track_disc</a>(track)) 
        printf(<span class="stringliteral">&quot;, %d on disc %d&quot;</span>,
               <a name="a7"></a><a class="code" href="group__track.html#ga25c1df9d32fd58f243397740b29c3f61">sp_track_index</a>(track),
               <a class="code" href="group__track.html#ga9d464ee4a5c8836b59888952b960223a">sp_track_disc</a>(track));
    printf(<span class="stringliteral">&quot;\n&quot;</span>);

    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="group__track.html#ga0aa945fc43e35d36cc334a52735d83b2">sp_track_num_artists</a>(track); i++) {
        <a class="code" href="group__types.html#ga31764fbd69618c10be173c6c03d4c1bc" title="An artist handle.">sp_artist</a> *art = <a name="a8"></a><a class="code" href="group__track.html#ga67cd0c035627a1e4a54642213fdf1d75">sp_track_artist</a>(track, i);
        printf(<span class="stringliteral">&quot;\tArtist %d: %s\n&quot;</span>, i + 1, <a name="a9"></a><a class="code" href="group__artist.html#gad2895555bb48514986823733a7afe5e2">sp_artist_name</a>(art));
    }
    l = <a name="a10"></a><a class="code" href="group__link.html#ga82c29419ce70e2b504670e3d45167d5d">sp_link_create_from_track</a>(track, 0);
    <a name="a11"></a><a class="code" href="group__link.html#ga9f169be53f098adcf12f7a10b8bd3ef7">sp_link_as_string</a>(l, url, <span class="keyword">sizeof</span>(url));
    printf(<span class="stringliteral">&quot;\t\t%s\n&quot;</span>, url);
    <a name="a12"></a><a class="code" href="group__link.html#ga2b06ab16d1f6436cd8d36dbff2b5c022">sp_link_release</a>(l);
}

<span class="keyword">static</span> <span class="keywordtype">void</span> print_albumbrowse(<a class="code" href="group__types.html#ga9c4550473a7a07790778ba870c31b4d9" title="A handle to an album browse result.">sp_albumbrowse</a> *browse)
{
    <span class="keywordtype">int</span> i;

    printf(<span class="stringliteral">&quot;Album browse of \&quot;%s\&quot; (%d)\n&quot;</span>, 
           <a name="a13"></a><a class="code" href="group__album.html#ga0e828c991a8184d60026513f944e19ad">sp_album_name</a>(<a name="a14"></a><a class="code" href="group__albumbrowse.html#gaf0dadfc4edb48a3558b606e30e8bedfa">sp_albumbrowse_album</a>(browse)), 
           <a name="a15"></a><a class="code" href="group__album.html#ga2aadf934b0af43c3ef6ee98b6a8065fd">sp_album_year</a>(<a class="code" href="group__albumbrowse.html#gaf0dadfc4edb48a3558b606e30e8bedfa">sp_albumbrowse_album</a>(browse)));

    <span class="keywordflow">for</span> (i = 0; i &lt; <a name="a16"></a><a class="code" href="group__albumbrowse.html#gab53fa74ee1958dad5186be09e70ddc4a">sp_albumbrowse_num_copyrights</a>(browse); ++i)
        printf(<span class="stringliteral">&quot;  Copyright: %s\n&quot;</span>, <a name="a17"></a><a class="code" href="group__albumbrowse.html#ga34b205daa2960e8d02a6e1accd80ab92">sp_albumbrowse_copyright</a>(browse, i));

    printf(<span class="stringliteral">&quot;  Tracks: %d\n&quot;</span>, <a name="a18"></a><a class="code" href="group__albumbrowse.html#ga3fb91de745ca07d3801a57288f2d9da7">sp_albumbrowse_num_tracks</a>(browse));
    printf(<span class="stringliteral">&quot;  Review: %.60s...\n&quot;</span>, <a name="a19"></a><a class="code" href="group__albumbrowse.html#ga868f3f3263f5033ae1fba60f403be712">sp_albumbrowse_review</a>(browse));
    puts(<span class="stringliteral">&quot;&quot;</span>);

    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="group__albumbrowse.html#ga3fb91de745ca07d3801a57288f2d9da7">sp_albumbrowse_num_tracks</a>(browse); ++i)
        print_track(<a name="a20"></a><a class="code" href="group__albumbrowse.html#gad3c8df4b75158bba2c06aaefa74c5aa1">sp_albumbrowse_track</a>(browse, i));

    puts(<span class="stringliteral">&quot;&quot;</span>);
}

<span class="keyword">static</span> <span class="keywordtype">void</span> print_artistbrowse(<a class="code" href="group__types.html#gafd3d5aae485f1012ec91b7948e6f9f2b" title="A handle to an artist browse result.">sp_artistbrowse</a> *browse)
{
    <span class="keywordtype">int</span> i;

    printf(<span class="stringliteral">&quot;Artist browse of \&quot;%s\&quot;\n&quot;</span>, <a class="code" href="group__artist.html#gad2895555bb48514986823733a7afe5e2">sp_artist_name</a>(<a name="a21"></a><a class="code" href="group__artistbrowse.html#ga5f6a046b2bd261d7628582b986a9019f">sp_artistbrowse_artist</a>(browse)));

    <span class="keywordflow">for</span> (i = 0; i &lt; <a name="a22"></a><a class="code" href="group__artistbrowse.html#ga2559638742416ac621af0e919e017d17">sp_artistbrowse_num_similar_artists</a>(browse); ++i)
        printf(<span class="stringliteral">&quot;  Similar artist: %s\n&quot;</span>, <a class="code" href="group__artist.html#gad2895555bb48514986823733a7afe5e2">sp_artist_name</a>(<a name="a23"></a><a class="code" href="group__artistbrowse.html#gac60ef4f9e006a920f1d72b6098743fbc">sp_artistbrowse_similar_artist</a>(browse, i)));

    printf(<span class="stringliteral">&quot;  Portraits: %d\n&quot;</span>, <a name="a24"></a><a class="code" href="group__artistbrowse.html#ga98dc47d36d2789999bfe62707c5041d7">sp_artistbrowse_num_portraits</a>(browse));
    printf(<span class="stringliteral">&quot;  Tracks   : %d\n&quot;</span>, <a name="a25"></a><a class="code" href="group__artistbrowse.html#ga8c862caa2234125ffcc4e93287b1e029">sp_artistbrowse_num_tracks</a>(browse));
    printf(<span class="stringliteral">&quot;  Biography: %.60s...\n&quot;</span>, <a name="a26"></a><a class="code" href="group__artistbrowse.html#ga8b93b9e5630662855f35694280ba4d2b">sp_artistbrowse_biography</a>(browse));
    puts(<span class="stringliteral">&quot;&quot;</span>);

    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="group__artistbrowse.html#ga8c862caa2234125ffcc4e93287b1e029">sp_artistbrowse_num_tracks</a>(browse); ++i)
        print_track(<a name="a27"></a><a class="code" href="group__artistbrowse.html#ga45d28771a856f935dc40ab40e27dec4c">sp_artistbrowse_track</a>(browse, i));

    puts(<span class="stringliteral">&quot;&quot;</span>);
}



<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV browse_album_callback(<a class="code" href="group__types.html#ga9c4550473a7a07790778ba870c31b4d9" title="A handle to an album browse result.">sp_albumbrowse</a> *browse, <span class="keywordtype">void</span> *userdata)
{
    <span class="keywordflow">if</span> (<a name="a28"></a><a class="code" href="group__albumbrowse.html#ga153417eee319e7711b66503f88fba88b">sp_albumbrowse_error</a>(browse) == <a name="a29"></a><a class="code" href="group__error.html#ggafd27986ce4cd9eeaeca8adda83c9eb6ba16cb277dc84328e4b2c0cf6d5a0c0b8d" title="No errors encountered.">SP_ERROR_OK</a>)
        print_albumbrowse(browse);
    <span class="keywordflow">else</span>
        fprintf(stderr, <span class="stringliteral">&quot;Failed to browse album: %s\n&quot;</span>,
                <a name="a30"></a><a class="code" href="group__error.html#ga983dee341d3c2008830513b7cffe7bf3">sp_error_message</a>(<a class="code" href="group__albumbrowse.html#ga153417eee319e7711b66503f88fba88b">sp_albumbrowse_error</a>(browse)));

    <a name="a31"></a><a class="code" href="group__albumbrowse.html#gabdd5a4e3b2098166b67e35979f59613d">sp_albumbrowse_release</a>(browse);
    cmd_done();
}


<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV browse_artist_callback(<a class="code" href="group__types.html#gafd3d5aae485f1012ec91b7948e6f9f2b" title="A handle to an artist browse result.">sp_artistbrowse</a> *browse, <span class="keywordtype">void</span> *userdata)
{
    <span class="keywordflow">if</span> (<a name="a32"></a><a class="code" href="group__artistbrowse.html#ga203e757088ff7a5098f16a1367da25d2">sp_artistbrowse_error</a>(browse) == <a class="code" href="group__error.html#ggafd27986ce4cd9eeaeca8adda83c9eb6ba16cb277dc84328e4b2c0cf6d5a0c0b8d" title="No errors encountered.">SP_ERROR_OK</a>)
        print_artistbrowse(browse);
    <span class="keywordflow">else</span>
        fprintf(stderr, <span class="stringliteral">&quot;Failed to browse artist: %s\n&quot;</span>,
                <a class="code" href="group__error.html#ga983dee341d3c2008830513b7cffe7bf3">sp_error_message</a>(<a class="code" href="group__artistbrowse.html#ga203e757088ff7a5098f16a1367da25d2">sp_artistbrowse_error</a>(browse)));

    <a name="a33"></a><a class="code" href="group__artistbrowse.html#ga14626a4f6a60b1caf61cb54c26783671">sp_artistbrowse_release</a>(browse);
    cmd_done();
}



<span class="keyword">static</span> <span class="keywordtype">void</span> track_browse_try(<span class="keywordtype">void</span>)
{
    <span class="keywordflow">switch</span> (<a name="a34"></a><a class="code" href="group__track.html#ga947c0f7755b0c4955ca0b0993db0f2b5">sp_track_error</a>(track_browse)) {
    <span class="keywordflow">case</span> <a class="code" href="group__error.html#ggafd27986ce4cd9eeaeca8adda83c9eb6ba16cb277dc84328e4b2c0cf6d5a0c0b8d" title="No errors encountered.">SP_ERROR_OK</a>:
        print_track(track_browse);
        <span class="keywordflow">break</span>;

    <span class="keywordflow">case</span> <a name="a35"></a><a class="code" href="group__error.html#ggafd27986ce4cd9eeaeca8adda83c9eb6ba17f54c30d01baedc24547e62ed417cdd" title="The resource is currently loading.">SP_ERROR_IS_LOADING</a>:
        <span class="keywordflow">return</span>; <span class="comment">// Still pending</span>

    <span class="keywordflow">default</span>:
        fprintf(stderr, <span class="stringliteral">&quot;Unable to resolve track: %s\n&quot;</span>, <a class="code" href="group__error.html#ga983dee341d3c2008830513b7cffe7bf3">sp_error_message</a>(<a class="code" href="group__track.html#ga947c0f7755b0c4955ca0b0993db0f2b5">sp_track_error</a>(track_browse)));
        <span class="keywordflow">break</span>;
    }
    
    metadata_updated_fn = NULL;
    cmd_done();
    <a name="a36"></a><a class="code" href="group__track.html#gaa11098d82e6c2ae42fc2ea1486e741de">sp_track_release</a>(track_browse);
}



<span class="keyword">static</span> <span class="keywordtype">void</span> playlist_browse_try(<span class="keywordtype">void</span>)
{
    <span class="keywordtype">int</span> i, tracks;

    metadata_updated_fn = playlist_browse_try;
    <span class="keywordflow">if</span>(!<a name="a37"></a><a class="code" href="group__playlist.html#gaee8ea6c07dfdca3397e27b278fa4870a">sp_playlist_is_loaded</a>(playlist_browse)) {
        printf(<span class="stringliteral">&quot;\tPlaylist not loaded\n&quot;</span>);
        <span class="keywordflow">return</span>;
    }

    tracks = <a name="a38"></a><a class="code" href="group__playlist.html#ga684a3acc60f99b3b26488ed813ee5d23">sp_playlist_num_tracks</a>(playlist_browse);
    <span class="keywordflow">for</span>(i = 0; i &lt; tracks; i++) {
        <a class="code" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48" title="A track handle.">sp_track</a> *t = <a name="a39"></a><a class="code" href="group__playlist.html#ga7a03854fe6072476306780d23c6cac16">sp_playlist_track</a>(playlist_browse, i);
        <span class="keywordflow">if</span> (!<a name="a40"></a><a class="code" href="group__track.html#ga8b69cf193679c7e00031ae43e61c6a54">sp_track_is_loaded</a>(t))
            <span class="keywordflow">return</span>;
    }

    printf(<span class="stringliteral">&quot;\tPlaylist and metadata loaded\n&quot;</span>);

    <span class="keywordflow">for</span>(i = 0; i &lt; tracks; i++) {
        <a class="code" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48" title="A track handle.">sp_track</a> *t = <a class="code" href="group__playlist.html#ga7a03854fe6072476306780d23c6cac16">sp_playlist_track</a>(playlist_browse, i);
        
        printf(<span class="stringliteral">&quot; %5d: &quot;</span>, i + 1);
        print_track(t);
    }
    <a name="a41"></a><a class="code" href="group__playlist.html#ga7fcbf909a0fa8bf25f0b1d1e7dd0e160">sp_playlist_remove_callbacks</a>(playlist_browse, &amp;pl_callbacks, NULL);

    <a name="a42"></a><a class="code" href="group__playlist.html#gacb9250eb530869b039541a8b62dfab6c">sp_playlist_release</a>(playlist_browse);
    playlist_browse = NULL;
    metadata_updated_fn = NULL;
    cmd_done();
}

<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV pl_tracks_added(<a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *pl, <a class="code" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48" title="A track handle.">sp_track</a> * <span class="keyword">const</span> * tracks,
                <span class="keywordtype">int</span> num_tracks, <span class="keywordtype">int</span> position, <span class="keywordtype">void</span> *userdata)
{
    printf(<span class="stringliteral">&quot;\t%d tracks added\n&quot;</span>, num_tracks);
}

<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV pl_tracks_removed(<a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *pl, <span class="keyword">const</span> <span class="keywordtype">int</span> *tracks,
                  <span class="keywordtype">int</span> num_tracks, <span class="keywordtype">void</span> *userdata)
{
    printf(<span class="stringliteral">&quot;\t%d tracks removed\n&quot;</span>, num_tracks);
}

<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV pl_tracks_moved(<a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *pl, <span class="keyword">const</span> <span class="keywordtype">int</span> *tracks,
                <span class="keywordtype">int</span> num_tracks, <span class="keywordtype">int</span> new_position, <span class="keywordtype">void</span> *userdata)
{
    printf(<span class="stringliteral">&quot;\t%d tracks moved\n&quot;</span>, num_tracks);
}

<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV pl_renamed(<a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *pl, <span class="keywordtype">void</span> *userdata)
{
    printf(<span class="stringliteral">&quot;\tList name: %s\n&quot;</span>,  <a name="a43"></a><a class="code" href="group__playlist.html#ga61b7e33cc1aedb4e31a2af75ae0ac8cc">sp_playlist_name</a>(pl));
}

<span class="keyword">static</span> <span class="keywordtype">void</span> SP_CALLCONV pl_state_change(<a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *pl, <span class="keywordtype">void</span> *userdata)
{
    playlist_browse_try();
}

<span class="keyword">static</span> <a class="code" href="structsp__playlist__callbacks.html">sp_playlist_callbacks</a> pl_callbacks = {
    pl_tracks_added,
    pl_tracks_removed,
    pl_tracks_moved,
    pl_renamed,
    pl_state_change,
};


<span class="keywordtype">void</span> browse_playlist(<a class="code" href="group__types.html#ga1bcf54cbc117a20ab2c15e59eb3a8174" title="A playlist handle.">sp_playlist</a> *pl)
{
    playlist_browse = pl;
    <a name="a44"></a><a class="code" href="group__playlist.html#gab15fca12d387c69b4998a4d2b48e5b32">sp_playlist_add_callbacks</a>(playlist_browse, &amp;pl_callbacks, NULL);
    playlist_browse_try();
}

<span class="keyword">static</span> <span class="keywordtype">void</span> browse_usage(<span class="keywordtype">void</span>)
{
    fprintf(stderr, <span class="stringliteral">&quot;Usage: browse &lt;spotify-uri&gt;\n&quot;</span>);
}


<span class="keywordtype">int</span> cmd_browse(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
{
    <a class="code" href="group__types.html#gaf90a23d6b662c96d52ac19f7f4bc1e39" title="A handle to the libspotify internal representation of a URI.">sp_link</a> *link;

    <span class="keywordflow">if</span> (argc != 2) {
        browse_usage();
        <span class="keywordflow">return</span> -1;
    }

    
    link = <a name="a45"></a><a class="code" href="group__link.html#gaea9c39f35f7986fc9fed4584fa211127">sp_link_create_from_string</a>(argv[1]);
    
    <span class="keywordflow">if</span> (!link) {
        fprintf(stderr, <span class="stringliteral">&quot;Not a spotify link\n&quot;</span>);
        <span class="keywordflow">return</span> -1;
    }

    <span class="keywordflow">switch</span>(<a name="a46"></a><a class="code" href="group__link.html#ga6140f924c696d53469bb8930cd53e1e6">sp_link_type</a>(link)) {
    <span class="keywordflow">default</span>:
        fprintf(stderr, <span class="stringliteral">&quot;Can not handle link&quot;</span>);
        <a class="code" href="group__link.html#ga2b06ab16d1f6436cd8d36dbff2b5c022">sp_link_release</a>(link);
        <span class="keywordflow">return</span> -1;

    <span class="keywordflow">case</span> <a name="a47"></a><a class="code" href="group__link.html#ggabe9611f04086cdbed6e4e6e1fd913b98a7716eb95eed852d08300e6e64febc7f3" title="Link type is album.">SP_LINKTYPE_ALBUM</a>:
        <a name="a48"></a><a class="code" href="group__albumbrowse.html#gaf1bc3042e748efea5ca7ac159e5cbfbe">sp_albumbrowse_create</a>(g_session, <a name="a49"></a><a class="code" href="group__link.html#gaafa98628d0abadcca27dd3b227c7337b">sp_link_as_album</a>(link), browse_album_callback, NULL);
        <span class="keywordflow">break</span>;

    <span class="keywordflow">case</span> <a name="a50"></a><a class="code" href="group__link.html#ggabe9611f04086cdbed6e4e6e1fd913b98a4402b3b001aebb39fd55296f83c60b7e" title="Link type is artist.">SP_LINKTYPE_ARTIST</a>:
        <a name="a51"></a><a class="code" href="group__artistbrowse.html#ga8dd8364b2fcd29c846209660bd9a69b2">sp_artistbrowse_create</a>(g_session, <a name="a52"></a><a class="code" href="group__link.html#gab32979d26dcf68936202fa7aed7b6e49">sp_link_as_artist</a>(link), <a name="a53"></a><a class="code" href="group__session.html#ggac86504cc9e8cadbc30c8aa8dbf355034a2914168528aded818177c013a0dd7e87">SP_ARTISTBROWSE_FULL</a>, browse_artist_callback, NULL);
        <span class="keywordflow">break</span>;

    <span class="keywordflow">case</span> <a name="a54"></a><a class="code" href="group__link.html#ggabe9611f04086cdbed6e4e6e1fd913b98a0698cd0123190c7af55daf79bb642805" title="Link type is a local file.">SP_LINKTYPE_LOCALTRACK</a>:
    <span class="keywordflow">case</span> <a name="a55"></a><a class="code" href="group__link.html#ggabe9611f04086cdbed6e4e6e1fd913b98a5911dbb7258ed160b2f9c114cef152f1" title="Link type is track.">SP_LINKTYPE_TRACK</a>:
        track_browse = <a name="a56"></a><a class="code" href="group__link.html#ga2560687997d7ce0fbf4f05251d87d32a">sp_link_as_track</a>(link);
        metadata_updated_fn = track_browse_try;
        <a name="a57"></a><a class="code" href="group__track.html#ga7d86041a2bf75590f55978521c08e38c">sp_track_add_ref</a>(track_browse);
        track_browse_try();
        <span class="keywordflow">break</span>;

    <span class="keywordflow">case</span> <a name="a58"></a><a class="code" href="group__link.html#ggabe9611f04086cdbed6e4e6e1fd913b98a2640ed065a64b6a9f67e71bbeb2af2dd" title="Link type is playlist.">SP_LINKTYPE_PLAYLIST</a>:
        browse_playlist(<a name="a59"></a><a class="code" href="group__playlist.html#ga342a6a0cfe10531ef7cb3c6629c1e8e7">sp_playlist_create</a>(g_session, link));
        <span class="keywordflow">break</span>;
    }

    <a class="code" href="group__link.html#ga2b06ab16d1f6436cd8d36dbff2b5c022">sp_link_release</a>(link);
    <span class="keywordflow">return</span> 0;
}
</pre></div> </div><!-- contents -->
<hr size="1"><address style="text-align: right;"><small>
Generated on Wed May 23 2012 11:04:07.<br>
Copyright &copy; 2006&ndash;2012 Spotify Ltd</small></address>
</body>
</html>
